fix(check): exclude test-runner files from app compatibility scans#2595
Closed
NathanDrake2406 wants to merge 1 commit into
Closed
fix(check): exclude test-runner files from app compatibility scans#2595NathanDrake2406 wants to merge 1 commit into
NathanDrake2406 wants to merge 1 commit into
Conversation
vinext check reports every __dirname and __filename occurrence as an unsupported migration issue, even though eligible server modules receive those globals automatically. This makes compatible server code look like a required rewrite during migration. The checker cannot determine whether every scanned source file is server-only or client-reachable. Classify the feature as partial, state the server and client boundary explicitly, and cover the original missing type:module combination in the formatted report.
commit: |
Contributor
Author
|
Closing because this patch only reclassified the compatibility report. The requested fix is to remove the underlying migration incompatibility at the affected runtime or init boundary; I am returning to the concrete app reproduction before proposing a replacement. |
Contributor
Author
|
GitHub would not reopen this PR after the requested force-push because the fork branch was recreated. The corrected root-cause patch is now #2596. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
vinext checkrecursively treated every JavaScript and TypeScript file as possible app runtime source.Why
vinext checkshould report compatibility for files that can contribute to the application bundle. Test modules and test-runner configuration execute under their own runners, so treating them as vinext runtime source creates migration work that does not exist.This was reproduced in a real Next.js to vinext migration of the movies-ranking app. The report marked CommonJS globals unsupported in exactly these files:
Both files are outside the vinext application runtime. The same checkout completed
vinext build, and its targeted Vitest file passed. With this PR's CLI, the app reports:*.test.*,*.spec.*, and conventional Jest, Playwright, and Vitest config files.config.site.config.tsand other non-test-runner configs in both scans.next/*imports do not constrain the deployed app.What changed
__dirnamein a Vitest test/confignext/*import used only by tests__dirnameor unsupported import insite.config.tsValidation
vp test run tests/check.test.ts: 145 tests passed.vp check: all 2,430 files formatted; no warnings, lint errors, or type errors across 1,080 files.vp run vinext#build: package build passed.vinext checkagainstmovies-ranking/.worktrees/nathan-vinext-jsonc-install: 98% compatible, 0 issues.bun run build:vinextin that movies-ranking worktree: all five build environments passed.bunx vitest run src/app/mobile-layout-alignment.test.ts: 4 tests passed.Risk / compatibility
Non-goals
config.References